##Setup
Map Ensembl ID to Gene Symbol in the counts file
Write Counts Data with Gene Symbol to CSV
Reading and filtering Hippocampus count and metadata files
Reading and filtering Cortex count and metadata files
Cortex: APP (APP vs WT) while controlling for all covariates (~Sex + Age + Diet + APP)
## Cortex: Running DESeq2 for APP (APP vs WT) while controlling for Sex, Age and Diet:padj < 0.05 and 0.10
## estimating size factors
## estimating dispersions
## gene-wise dispersion estimates
## mean-dispersion relationship
## final dispersion estimates
## fitting model and testing
## resultsNames:
## [1] "Intercept" "Sex_M_vs_F"
## [3] "Age_6_vs_3" "Age_9_vs_3"
## [5] "Age_12_vs_3" "Diet_Supplemented_vs_Control"
## [7] "APP_APP_vs_WT"
##
## out of 34880 with nonzero total read count
## adjusted p-value < 0.1
## LFC > 0 (up) : 4514, 13%
## LFC < 0 (down) : 4450, 13%
## outliers [1] : 158, 0.45%
## low counts [2] : 8047, 23%
## (mean count < 1)
## [1] see 'cooksCutoff' argument of ?results
## [2] see 'independentFiltering' argument of ?results
## log2 fold change (MLE): APP APP vs WT
## Wald test p-value: APP APP vs WT
## DataFrame with 10 rows and 6 columns
## baseMean log2FoldChange lfcSE stat pvalue
## <numeric> <numeric> <numeric> <numeric> <numeric>
## ENSMUSG00000079293 823.4879 5.98073 0.1649285 36.2626 6.29673e-288
## ENSMUSG00000068129 1858.8971 7.18695 0.2266836 31.7048 1.33521e-220
## ENSMUSG00000018927 788.3634 3.74866 0.1227579 30.5370 8.41468e-205
## ENSMUSG00000030789 1139.3238 5.91246 0.1951157 30.3023 1.06803e-201
## ENSMUSG00000018930 37.1405 4.04061 0.1582950 25.5258 1.01880e-143
## ENSMUSG00000028362 50.7635 4.24150 0.1682644 25.2074 3.32567e-140
## ENSMUSG00000097415 416.7944 2.07749 0.0828034 25.0895 6.47984e-139
## ENSMUSG00000040552 438.1673 1.84921 0.0755165 24.4875 2.00863e-132
## ENSMUSG00000044468 619.6459 2.05062 0.0847030 24.2095 1.76691e-129
## ENSMUSG00000000982 183.1320 4.29731 0.1782946 24.1023 2.36417e-128
## padj
## <numeric>
## ENSMUSG00000079293 1.67965e-283
## ENSMUSG00000068129 1.78084e-216
## ENSMUSG00000018927 7.48206e-201
## ENSMUSG00000030789 7.12245e-198
## ENSMUSG00000018930 5.43532e-140
## ENSMUSG00000028362 1.47854e-136
## ENSMUSG00000097415 2.46928e-135
## ENSMUSG00000040552 6.69751e-129
## ENSMUSG00000044468 5.23692e-126
## ENSMUSG00000000982 6.30642e-125
## log2 fold change (MLE): APP APP vs WT
## Wald test p-value: APP APP vs WT
## DataFrame with 34880 rows and 6 columns
## baseMean log2FoldChange lfcSE stat pvalue
## <numeric> <numeric> <numeric> <numeric> <numeric>
## ENSMUSG00000079293 823.4879 5.98073 0.164928 36.2626 6.29673e-288
## ENSMUSG00000068129 1858.8971 7.18695 0.226684 31.7048 1.33521e-220
## ENSMUSG00000018927 788.3634 3.74866 0.122758 30.5370 8.41468e-205
## ENSMUSG00000030789 1139.3238 5.91246 0.195116 30.3023 1.06803e-201
## ENSMUSG00000018930 37.1405 4.04061 0.158295 25.5258 1.01880e-143
## ... ... ... ... ... ...
## ENSMUSG00000064359 0.161461 -0.148898 1.76922 -0.0841602 0.932929
## ENSMUSG00000064366 0.117536 -0.028032 1.70277 -0.0164626 0.986865
## ENSMUSG00000095672 0.103382 0.347359 2.07551 0.1673606 0.867086
## ENSMUSG00000079222 0.124061 0.339879 2.20707 0.1539954 0.877613
## ENSMUSG00000079794 0.341101 -0.634836 1.12441 -0.5645934 0.572350
## padj
## <numeric>
## ENSMUSG00000079293 1.67965e-283
## ENSMUSG00000068129 1.78084e-216
## ENSMUSG00000018927 7.48206e-201
## ENSMUSG00000030789 7.12245e-198
## ENSMUSG00000018930 5.43532e-140
## ... ...
## ENSMUSG00000064359 NA
## ENSMUSG00000064366 NA
## ENSMUSG00000095672 NA
## ENSMUSG00000079222 NA
## ENSMUSG00000079794 NA
## class: DESeqDataSet
## dim: 34880 96
## metadata(1): version
## assays(4): counts mu H cooks
## rownames(34880): ENSMUSG00000102628 ENSMUSG00000097426 ...
## ENSMUSG00000095041 ENSMUSG00000095742
## rowData names(42): baseMean baseVar ... deviance maxCooks
## colnames(96): 102 103 ... 95 96
## colData names(5): Sex Diet Age APP sizeFactor
## Cortex DESeq2 result is saved in file: 'Cortex_deseq_results_APP_all.csv'
## Cortex DESeq2 normalized counts is saved in file: 'Cortex_deseq_norm_counts_APP_all.csv'
## Cortex DESeq2 result with Gene names (mgi_symbols) is saved in file: 'Cortex_deseq_results_with_genename_APP_all.csv'
## [1] 34880
## [1] 7513
## Cortex DESeq2 result after padj (0.05) filtering is saved in file: 'Cortex_deseq_results_APP_all_padj_05_filtered.csv'
## Number of DE genes significant at padj < 0.05 for Cortex:APP (APP vs WT) while controlling Sex, Age and Diet: 7513
## Number of DE genes discarded after padj threshold 0.05 filtering for Cortex:APP(APP vs WT) while controlling Sex, Age and Diet: 27367
## [1] 34880
## [1] 8964
## Cortex DESeq2 result after padj (0.1) filtering is saved in file: 'Cortex_deseq_results_APP_all_padj_1_filtered.csv'
## Number of DE genes significant at padj < 0.1 for Cortex:APP (APP vs WT) while controlling Sex, Age and Diet: 8964
## Number of DE genes discarded after padj threshold 0.1 filtering for Cortex:APP(APP vs WT) while controlling Sex, Age and Diet: 25916
## Warning: ggrepel: 7493 unlabeled data points (too many overlaps). Consider
## increasing max.overlaps
8 Cortex: PCA
## ************** Principal Component Analysis (PCA) **************
## class: DESeqTransform
## dim: 34880 96
## metadata(1): version
## assays(1): ''
## rownames(34880): ENSMUSG00000102628 ENSMUSG00000097426 ...
## ENSMUSG00000095041 ENSMUSG00000095742
## rowData names(42): baseMean baseVar ... deviance maxCooks
## colnames(96): 102 103 ... 95 96
## colData names(5): Sex Diet Age APP sizeFactor
## Importance of components:
## PC1 PC2 PC3 PC4 PC5 PC6
## Standard deviation 62.0691 47.2091 43.43561 39.2192 30.52674 28.06197
## Proportion of Variance 0.1105 0.0639 0.05409 0.0441 0.02672 0.02258
## Cumulative Proportion 0.1105 0.1744 0.22844 0.2725 0.29925 0.32183
## PC7 PC8 PC9 PC10 PC11 PC12
## Standard deviation 27.87897 26.57108 25.07750 24.19879 23.78723 22.48140
## Proportion of Variance 0.02228 0.02024 0.01803 0.01679 0.01622 0.01449
## Cumulative Proportion 0.34411 0.36435 0.38238 0.39917 0.41540 0.42989
## PC13 PC14 PC15 PC16 PC17 PC18
## Standard deviation 21.64538 20.17774 19.77058 19.23614 19.02146 18.7665
## Proportion of Variance 0.01343 0.01167 0.01121 0.01061 0.01037 0.0101
## Cumulative Proportion 0.44332 0.45499 0.46620 0.47681 0.48718 0.4973
## PC19 PC20 PC21 PC22 PC23 PC24
## Standard deviation 18.42451 18.17533 18.04444 17.78258 17.60624 17.38005
## Proportion of Variance 0.00973 0.00947 0.00933 0.00907 0.00889 0.00866
## Cumulative Proportion 0.50701 0.51648 0.52581 0.53488 0.54377 0.55243
## PC25 PC26 PC27 PC28 PC29 PC30
## Standard deviation 17.26232 17.19011 16.97787 16.92400 16.83790 16.72540
## Proportion of Variance 0.00854 0.00847 0.00826 0.00821 0.00813 0.00802
## Cumulative Proportion 0.56097 0.56944 0.57771 0.58592 0.59405 0.60207
## PC31 PC32 PC33 PC34 PC35 PC36
## Standard deviation 16.56356 16.40628 16.36023 16.31078 16.11885 16.01803
## Proportion of Variance 0.00787 0.00772 0.00767 0.00763 0.00745 0.00736
## Cumulative Proportion 0.60993 0.61765 0.62532 0.63295 0.64040 0.64775
## PC37 PC38 PC39 PC40 PC41 PC42
## Standard deviation 15.94019 15.85598 15.83916 15.78594 15.77478 15.65578
## Proportion of Variance 0.00728 0.00721 0.00719 0.00714 0.00713 0.00703
## Cumulative Proportion 0.65504 0.66225 0.66944 0.67658 0.68372 0.69074
## PC43 PC44 PC45 PC46 PC47 PC48
## Standard deviation 15.61466 15.55155 15.47870 15.43806 15.36342 15.32200
## Proportion of Variance 0.00699 0.00693 0.00687 0.00683 0.00677 0.00673
## Cumulative Proportion 0.69774 0.70467 0.71154 0.71837 0.72514 0.73187
## PC49 PC50 PC51 PC52 PC53 PC54
## Standard deviation 15.27167 15.24753 15.19989 15.12776 15.10515 15.04049
## Proportion of Variance 0.00669 0.00667 0.00662 0.00656 0.00654 0.00649
## Cumulative Proportion 0.73855 0.74522 0.75184 0.75841 0.76495 0.77143
## PC55 PC56 PC57 PC58 PC59 PC60
## Standard deviation 15.00100 14.98112 14.89375 14.83836 14.8294 14.81184
## Proportion of Variance 0.00645 0.00643 0.00636 0.00631 0.0063 0.00629
## Cumulative Proportion 0.77788 0.78432 0.79068 0.79699 0.8033 0.80958
## PC61 PC62 PC63 PC64 PC65 PC66
## Standard deviation 14.72891 14.7073 14.69490 14.60399 14.5829 14.52986
## Proportion of Variance 0.00622 0.0062 0.00619 0.00611 0.0061 0.00605
## Cumulative Proportion 0.81580 0.8220 0.82820 0.83431 0.8404 0.84646
## PC67 PC68 PC69 PC70 PC71 PC72
## Standard deviation 14.50349 14.42430 14.39881 14.32419 14.29788 14.27752
## Proportion of Variance 0.00603 0.00597 0.00594 0.00588 0.00586 0.00584
## Cumulative Proportion 0.85249 0.85846 0.86440 0.87028 0.87614 0.88199
## PC73 PC74 PC75 PC76 PC77 PC78
## Standard deviation 14.2207 14.14266 14.11283 14.06282 14.04241 13.9728
## Proportion of Variance 0.0058 0.00573 0.00571 0.00567 0.00565 0.0056
## Cumulative Proportion 0.8878 0.89352 0.89923 0.90490 0.91055 0.9162
## PC79 PC80 PC81 PC82 PC83 PC84
## Standard deviation 13.90497 13.85897 13.76516 13.73979 13.62045 13.5923
## Proportion of Variance 0.00554 0.00551 0.00543 0.00541 0.00532 0.0053
## Cumulative Proportion 0.92169 0.92720 0.93263 0.93805 0.94336 0.9487
## PC85 PC86 PC87 PC88 PC89 PC90
## Standard deviation 13.52340 13.48809 13.37789 13.17780 12.99373 12.84734
## Proportion of Variance 0.00524 0.00522 0.00513 0.00498 0.00484 0.00473
## Cumulative Proportion 0.95390 0.95912 0.96425 0.96923 0.97407 0.97880
## PC91 PC92 PC93 PC94 PC95 PC96
## Standard deviation 12.72544 12.51280 12.35435 11.73444 11.42502 3.713e-13
## Proportion of Variance 0.00464 0.00449 0.00438 0.00395 0.00374 0.000e+00
## Cumulative Proportion 0.98345 0.98793 0.99231 0.99626 1.00000 1.000e+00
## [1] 1.104523e-01 6.389620e-02 5.408981e-02 4.409825e-02 2.671680e-02
## [6] 2.257666e-02 2.228316e-02 2.024147e-02 1.802984e-02 1.678846e-02
## [11] 1.622225e-02 1.449006e-02 1.343241e-02 1.167263e-02 1.120630e-02
## [16] 1.060863e-02 1.037316e-02 1.009699e-02 9.732303e-03 9.470829e-03
## [21] 9.334919e-03 9.065941e-03 8.887031e-03 8.660152e-03 8.543222e-03
## [26] 8.471899e-03 8.263990e-03 8.211633e-03 8.128294e-03 8.020042e-03
## [31] 7.865585e-03 7.716912e-03 7.673654e-03 7.627341e-03 7.448890e-03
## [36] 7.355997e-03 7.284677e-03 7.207920e-03 7.192632e-03 7.144382e-03
## [41] 7.134284e-03 7.027045e-03 6.990184e-03 6.933794e-03 6.868981e-03
## [46] 6.832965e-03 6.767046e-03 6.730607e-03 6.686469e-03 6.665340e-03
## [51] 6.623758e-03 6.561040e-03 6.541448e-03 6.485561e-03 6.451549e-03
## [56] 6.434456e-03 6.359627e-03 6.312414e-03 6.304828e-03 6.289864e-03
## [61] 6.219631e-03 6.201412e-03 6.190941e-03 6.114583e-03 6.096942e-03
## [66] 6.052662e-03 6.030712e-03 5.965036e-03 5.943972e-03 5.882525e-03
## [71] 5.860931e-03 5.844257e-03 5.797795e-03 5.734371e-03 5.710205e-03
## [76] 5.669810e-03 5.653365e-03 5.597449e-03 5.543242e-03 5.506624e-03
## [81] 5.432328e-03 5.412325e-03 5.318715e-03 5.296717e-03 5.243187e-03
## [86] 5.215842e-03 5.130965e-03 4.978622e-03 4.840509e-03 4.732060e-03
## [91] 4.642685e-03 4.488825e-03 4.375861e-03 3.947741e-03 3.742292e-03
## [96] 3.951672e-30
## # A tibble: 5 × 3
## variance_explained principal_components cumulative
## <dbl> <chr> <dbl>
## 1 0.110 PC1 0.110
## 2 0.0639 PC2 0.174
## 3 0.0541 PC3 0.228
## 4 0.0441 PC4 0.273
## 5 0.0267 PC5 0.299
## Hippocampus: Running DESeq2 for APP (APP vs WT) while controlling for Sex, Age and Diet:padj < 0.05 and 0.10
## estimating size factors
## estimating dispersions
## gene-wise dispersion estimates
## mean-dispersion relationship
## final dispersion estimates
## fitting model and testing
## resultsNames:
## [1] "Intercept" "Sex_M_vs_F"
## [3] "Age_6_vs_3" "Age_9_vs_3"
## [5] "Age_12_vs_3" "Diet_Supplemented_vs_Control"
## [7] "APP_APP_vs_WT"
##
## out of 33271 with nonzero total read count
## adjusted p-value < 0.1
## LFC > 0 (up) : 4316, 13%
## LFC < 0 (down) : 4492, 14%
## outliers [1] : 118, 0.35%
## low counts [2] : 12231, 37%
## (mean count < 3)
## [1] see 'cooksCutoff' argument of ?results
## [2] see 'independentFiltering' argument of ?results
## log2 fold change (MLE): APP APP vs WT
## Wald test p-value: APP APP vs WT
## DataFrame with 10 rows and 6 columns
## baseMean log2FoldChange lfcSE stat pvalue
## <numeric> <numeric> <numeric> <numeric> <numeric>
## ENSMUSG00000068129 933.4821 6.48084 0.2127809 30.4578 9.43854e-204
## ENSMUSG00000079293 468.4345 4.27618 0.1672249 25.5715 3.17027e-144
## ENSMUSG00000030789 453.6241 4.90642 0.2063859 23.7730 6.34804e-125
## ENSMUSG00000018927 440.8573 2.74052 0.1323215 20.7111 2.75087e-95
## ENSMUSG00000000982 80.2961 3.45517 0.1788623 19.3175 3.82703e-83
## ENSMUSG00000000682 187.4863 2.35327 0.1293266 18.1963 5.52026e-74
## ENSMUSG00000046805 4465.5369 1.55282 0.0864279 17.9666 3.55724e-72
## ENSMUSG00000021423 1263.4021 1.45646 0.0850689 17.1209 1.03617e-65
## ENSMUSG00000059498 1038.5126 1.15766 0.0685324 16.8921 5.14376e-64
## ENSMUSG00000045502 35.0418 3.72873 0.2254217 16.5411 1.85462e-61
## padj
## <numeric>
## ENSMUSG00000068129 1.97473e-199
## ENSMUSG00000079293 3.31641e-140
## ENSMUSG00000030789 4.42712e-121
## ENSMUSG00000018927 1.43884e-91
## ENSMUSG00000000982 1.60138e-79
## ENSMUSG00000000682 1.92491e-70
## ENSMUSG00000046805 1.06321e-68
## ENSMUSG00000021423 2.70985e-62
## ENSMUSG00000059498 1.19575e-60
## ENSMUSG00000045502 3.88023e-58
## log2 fold change (MLE): APP APP vs WT
## Wald test p-value: APP APP vs WT
## DataFrame with 33271 rows and 6 columns
## baseMean log2FoldChange lfcSE stat pvalue
## <numeric> <numeric> <numeric> <numeric> <numeric>
## ENSMUSG00000068129 933.4821 6.48084 0.212781 30.4578 9.43854e-204
## ENSMUSG00000079293 468.4345 4.27618 0.167225 25.5715 3.17027e-144
## ENSMUSG00000030789 453.6241 4.90642 0.206386 23.7730 6.34804e-125
## ENSMUSG00000018927 440.8573 2.74052 0.132321 20.7111 2.75087e-95
## ENSMUSG00000000982 80.2961 3.45517 0.178862 19.3175 3.82703e-83
## ... ... ... ... ... ...
## ENSMUSG00000064369 2.5058343 -0.4070268 0.256574 -1.5863899 0.1126509
## ENSMUSG00000079190 0.2880846 0.9207706 1.719795 0.5353956 0.5923763
## ENSMUSG00000079222 0.0739574 0.0837194 2.915113 0.0287191 0.9770886
## ENSMUSG00000062783 0.1831708 0.4689407 1.985131 0.2362266 0.8132569
## ENSMUSG00000079808 0.7429405 1.3055529 0.761301 1.7148980 0.0863639
## padj
## <numeric>
## ENSMUSG00000068129 1.97473e-199
## ENSMUSG00000079293 3.31641e-140
## ENSMUSG00000030789 4.42712e-121
## ENSMUSG00000018927 1.43884e-91
## ENSMUSG00000000982 1.60138e-79
## ... ...
## ENSMUSG00000064369 NA
## ENSMUSG00000079190 NA
## ENSMUSG00000079222 NA
## ENSMUSG00000062783 NA
## ENSMUSG00000079808 NA
## class: DESeqDataSet
## dim: 33271 96
## metadata(1): version
## assays(4): counts mu H cooks
## rownames(33271): ENSMUSG00000102628 ENSMUSG00000086053 ...
## ENSMUSG00000095041 ENSMUSG00000095742
## rowData names(42): baseMean baseVar ... deviance maxCooks
## colnames(96): 102 103 ... 95 96
## colData names(5): Sex Diet Age APP sizeFactor
## Hippocampus DESeq2 result is saved in file: 'Hippocampus_deseq_results_APP_all.csv'
## Hippocampus DESeq2 normalized counts is saved in file: 'Hippocampus_deseq_norm_counts_APP_all.csv'
## Hippocampus DESeq2 result with Gene names (mgi_symbols) is saved in file: 'Hippocampus_deseq_results_with_genename_APP_all.csv'
## Hippocampus DESeq2 result after padj (0.05) filtering is saved in file: 'Hippocampus_deseq_results_APP_all_padj_05_filtered.csv'
## Number of DE genes significant at padj < 0.05 for Hippocampus:APP (APP vs WT) while controlling Sex, Age and Diet: 6720
## Number of DE genes discarded after padj threshold < 0.05 filtering for Hippocampus:APP (APP vs WT) while controlling Sex, Age and Diet: 26551
## Hippocampus DESeq2 result after padj (0.1) filtering is saved in file: 'Hippocampus_deseq_results_APP_all_padj_1_filtered.csv'
## Number of DE genes significant at padj < 0.1 for Hippocampus:APP (APP vs WT) while controlling Sex, Age and Diet: 8808
## Number of DE genes discarded after padj threshold < 0.1 filtering for Hippocampus:APP(APP vs WT) while controlling Sex, Age and Diet: 24463
## Warning: ggrepel: 6707 unlabeled data points (too many overlaps). Consider
## increasing max.overlaps
12 Hippocampus: PCA
## ************** Principal Component Analysis (PCA) **************
## class: DESeqTransform
## dim: 33271 96
## metadata(1): version
## assays(1): ''
## rownames(33271): ENSMUSG00000102628 ENSMUSG00000086053 ...
## ENSMUSG00000095041 ENSMUSG00000095742
## rowData names(42): baseMean baseVar ... deviance maxCooks
## colnames(96): 102 103 ... 95 96
## colData names(5): Sex Diet Age APP sizeFactor
## Importance of components:
## PC1 PC2 PC3 PC4 PC5 PC6
## Standard deviation 90.3374 40.46986 32.62333 29.76544 26.69543 25.7985
## Proportion of Variance 0.2453 0.04923 0.03199 0.02663 0.02142 0.0200
## Cumulative Proportion 0.2453 0.29451 0.32650 0.35313 0.37455 0.3946
## PC7 PC8 PC9 PC10 PC11 PC12
## Standard deviation 22.4106 21.61071 20.40882 19.90844 19.61700 19.1281
## Proportion of Variance 0.0151 0.01404 0.01252 0.01191 0.01157 0.0110
## Cumulative Proportion 0.4097 0.42368 0.43620 0.44812 0.45968 0.4707
## PC13 PC14 PC15 PC16 PC17 PC18
## Standard deviation 18.65039 18.45338 18.06351 17.53585 17.26056 16.77386
## Proportion of Variance 0.01045 0.01023 0.00981 0.00924 0.00895 0.00846
## Cumulative Proportion 0.48113 0.49137 0.50118 0.51042 0.51937 0.52783
## PC19 PC20 PC21 PC22 PC23 PC24
## Standard deviation 16.66584 16.55476 16.2123 16.16840 16.07476 15.98455
## Proportion of Variance 0.00835 0.00824 0.0079 0.00786 0.00777 0.00768
## Cumulative Proportion 0.53618 0.54441 0.5523 0.56017 0.56794 0.57562
## PC25 PC26 PC27 PC28 PC29 PC30
## Standard deviation 15.7913 15.76898 15.74085 15.65944 15.59203 15.47032
## Proportion of Variance 0.0075 0.00747 0.00745 0.00737 0.00731 0.00719
## Cumulative Proportion 0.5831 0.59059 0.59803 0.60540 0.61271 0.61990
## PC31 PC32 PC33 PC34 PC35 PC36
## Standard deviation 15.45627 15.35796 15.26783 15.22922 15.22245 15.1526
## Proportion of Variance 0.00718 0.00709 0.00701 0.00697 0.00696 0.0069
## Cumulative Proportion 0.62708 0.63417 0.64118 0.64815 0.65512 0.6620
## PC37 PC38 PC39 PC40 PC41 PC42
## Standard deviation 15.11612 15.08163 15.01432 14.94051 14.90765 14.85063
## Proportion of Variance 0.00687 0.00684 0.00678 0.00671 0.00668 0.00663
## Cumulative Proportion 0.66888 0.67572 0.68250 0.68921 0.69589 0.70251
## PC43 PC44 PC45 PC46 PC47 PC48
## Standard deviation 14.83491 14.77117 14.71755 14.7031 14.5899 14.57080
## Proportion of Variance 0.00661 0.00656 0.00651 0.0065 0.0064 0.00638
## Cumulative Proportion 0.70913 0.71569 0.72220 0.7287 0.7351 0.74147
## PC49 PC50 PC51 PC52 PC53 PC54
## Standard deviation 14.52834 14.48721 14.44832 14.43433 14.40562 14.33001
## Proportion of Variance 0.00634 0.00631 0.00627 0.00626 0.00624 0.00617
## Cumulative Proportion 0.74782 0.75413 0.76040 0.76666 0.77290 0.77907
## PC55 PC56 PC57 PC58 PC59 PC60
## Standard deviation 14.29824 14.23271 14.20749 14.19897 14.14211 14.11407
## Proportion of Variance 0.00614 0.00609 0.00607 0.00606 0.00601 0.00599
## Cumulative Proportion 0.78522 0.79130 0.79737 0.80343 0.80944 0.81543
## PC61 PC62 PC63 PC64 PC65 PC66
## Standard deviation 14.09262 14.05855 13.98753 13.96748 13.93105 13.90883
## Proportion of Variance 0.00597 0.00594 0.00588 0.00586 0.00583 0.00581
## Cumulative Proportion 0.82140 0.82734 0.83322 0.83908 0.84492 0.85073
## PC67 PC68 PC69 PC70 PC71 PC72
## Standard deviation 13.80496 13.75903 13.73146 13.68519 13.64327 13.60492
## Proportion of Variance 0.00573 0.00569 0.00567 0.00563 0.00559 0.00556
## Cumulative Proportion 0.85646 0.86215 0.86782 0.87345 0.87904 0.88460
## PC73 PC74 PC75 PC76 PC77 PC78
## Standard deviation 13.5271 13.45292 13.41007 13.39542 13.34023 13.31905
## Proportion of Variance 0.0055 0.00544 0.00541 0.00539 0.00535 0.00533
## Cumulative Proportion 0.8901 0.89554 0.90095 0.90634 0.91169 0.91702
## PC79 PC80 PC81 PC82 PC83 PC84
## Standard deviation 13.25343 13.20297 13.16718 13.11305 13.05575 12.99794
## Proportion of Variance 0.00528 0.00524 0.00521 0.00517 0.00512 0.00508
## Cumulative Proportion 0.92230 0.92754 0.93275 0.93792 0.94304 0.94812
## PC85 PC86 PC87 PC88 PC89 PC90
## Standard deviation 12.91775 12.87196 12.78578 12.7670 12.70706 12.60887
## Proportion of Variance 0.00502 0.00498 0.00491 0.0049 0.00485 0.00478
## Cumulative Proportion 0.95314 0.95812 0.96303 0.9679 0.97278 0.97756
## PC91 PC92 PC93 PC94 PC95 PC96
## Standard deviation 12.48854 12.46730 12.44995 11.90737 11.76471 2.458e-13
## Proportion of Variance 0.00469 0.00467 0.00466 0.00426 0.00416 0.000e+00
## Cumulative Proportion 0.98225 0.98692 0.99158 0.99584 1.00000 1.000e+00
## [1] 2.452838e-01 4.922635e-02 3.198827e-02 2.662923e-02 2.141943e-02
## [6] 2.000425e-02 1.509528e-02 1.403693e-02 1.251901e-02 1.191265e-02
## [11] 1.156643e-02 1.099715e-02 1.045467e-02 1.023495e-02 9.807052e-03
## [16] 9.242464e-03 8.954553e-03 8.456684e-03 8.348116e-03 8.237204e-03
## [21] 7.899945e-03 7.857205e-03 7.766457e-03 7.679536e-03 7.495002e-03
## [26] 7.473797e-03 7.447158e-03 7.370326e-03 7.307010e-03 7.193371e-03
## [31] 7.180312e-03 7.089265e-03 7.006298e-03 6.970914e-03 6.964709e-03
## [36] 6.900909e-03 6.867754e-03 6.836449e-03 6.775561e-03 6.709111e-03
## [41] 6.679634e-03 6.628630e-03 6.614608e-03 6.557889e-03 6.510362e-03
## [46] 6.497571e-03 6.397930e-03 6.381177e-03 6.344046e-03 6.308175e-03
## [51] 6.274350e-03 6.262211e-03 6.237323e-03 6.172016e-03 6.144683e-03
## [56] 6.088482e-03 6.066932e-03 6.059651e-03 6.011217e-03 5.987405e-03
## [61] 5.969217e-03 5.940395e-03 5.880525e-03 5.863676e-03 5.833135e-03
## [66] 5.814541e-03 5.728022e-03 5.689970e-03 5.667192e-03 5.629055e-03
## [71] 5.594622e-03 5.563216e-03 5.499717e-03 5.439603e-03 5.405009e-03
## [76] 5.393200e-03 5.348855e-03 5.331880e-03 5.279473e-03 5.239347e-03
## [81] 5.210986e-03 5.168228e-03 5.123162e-03 5.077892e-03 5.015426e-03
## [86] 4.979936e-03 4.913476e-03 4.899035e-03 4.853160e-03 4.778443e-03
## [91] 4.687677e-03 4.671740e-03 4.658749e-03 4.261530e-03 4.160034e-03
## [96] 1.815907e-30
## # A tibble: 5 × 3
## variance_explained principal_components cumulative
## <dbl> <chr> <dbl>
## 1 0.245 PC1 0.245
## 2 0.0492 PC2 0.295
## 3 0.0320 PC3 0.326
## 4 0.0266 PC4 0.353
## 5 0.0214 PC5 0.375
Perform a GSEA using a ranked list log2FoldChange values for all genes discovered in the DESeq2 results against the M2 Canonical Pathways gene set collection. Convert gene identifiers in the results to the appropriate matching format found in the M2 gene sets. fgsea expects a named vector of gene level statistics and the gene sets in the form of a named list.
Using “m2.cp.wikipathways.v0.3.symbols.gmt” which is the Canonical Pathways gene sets derived from the WikiPathways pathway database (WikiPathways subset of CP)
## # A tibble: 34,880 × 8
## genes volc_pl…¹ log2F…² padj baseM…³ lfcSE stat pvalue
## <chr> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
## 1 ENSMUSG00000079293 UP 5.98 1.68e-283 823. 0.165 36.3 6.30e-288
## 2 ENSMUSG00000068129 UP 7.19 1.78e-216 1859. 0.227 31.7 1.34e-220
## 3 ENSMUSG00000018927 UP 3.75 7.48e-201 788. 0.123 30.5 8.41e-205
## 4 ENSMUSG00000030789 UP 5.91 7.12e-198 1139. 0.195 30.3 1.07e-201
## 5 ENSMUSG00000018930 UP 4.04 5.44e-140 37.1 0.158 25.5 1.02e-143
## 6 ENSMUSG00000028362 UP 4.24 1.48e-136 50.8 0.168 25.2 3.33e-140
## 7 ENSMUSG00000097415 UP 2.08 2.47e-135 417. 0.0828 25.1 6.48e-139
## 8 ENSMUSG00000040552 UP 1.85 6.70e-129 438. 0.0755 24.5 2.01e-132
## 9 ENSMUSG00000044468 UP 2.05 5.24e-126 620. 0.0847 24.2 1.77e-129
## 10 ENSMUSG00000000982 UP 4.30 6.31e-125 183. 0.178 24.1 2.36e-128
## # … with 34,870 more rows, and abbreviated variable names ¹volc_plot_status,
## # ²log2FoldChange, ³baseMean
## # ℹ Use `print(n = ...)` to see more rows
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (0.15% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize,
## gseaParam, : There are duplicate gene names, fgsea may produce unexpected
## results.
## Warning in fgseaMultilevel(...): For some of the pathways the P-values were
## likely overestimated. For such pathways log2err is set to NA.
## # A tibble: 190 × 8
## pathway pval padj log2err ES NES size leadi…¹
## <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <int> <list>
## 1 WP_MONOAMINE_GPCRS 5.27e-5 0.00500 0.557 -0.648 -2.13 33 <chr>
## 2 WP_HYPOTHETICAL_NETWORK_F… 4.31e-4 0.0205 0.498 -0.641 -2.11 31 <chr>
## 3 WP_SPLICING_FACTOR_NOVA_R… 9.51e-3 0.201 0.381 -0.486 -1.71 41 <chr>
## 4 WP_HYPOXIADEPENDENT_DIFFE… 2.09e-2 0.305 0.352 -0.673 -1.70 13 <chr>
## 5 WP_AFLATOXIN_B1_METABOLISM 8.19e-2 0.557 0.288 -0.780 -1.55 5 <chr>
## 6 WP_GPCRS_CLASS_C_METABOTR… 4.17e-2 0.466 0.322 -0.589 -1.54 15 <chr>
## 7 WP_ACETYLCHOLINE_SYNTHESIS 1.42e-1 0.614 0.249 -0.687 -1.52 7 <chr>
## 8 WP_REGULATION_OF_CARDIAC_… 1.01e-1 0.557 0.253 -0.704 -1.45 6 <chr>
## 9 WP_HYPOXIADEPENDENT_SELFR… 1.23e-1 0.557 0.288 -0.557 -1.41 13 <chr>
## 10 WP_HYPOXIADEPENDENT_PROLI… 1.10e-1 0.557 0.288 -0.493 -1.38 19 <chr>
## # … with 180 more rows, and abbreviated variable name ¹leadingEdge
## # ℹ Use `print(n = ...)` to see more rows
## Cortex NES ordered fgsea results saved in file: 'Cortex_NES_ordered_fgsea_results_APP_all_FC0.csv'
## # A tibble: 33,271 × 8
## genes volc_pl…¹ log2F…² padj baseM…³ lfcSE stat pvalue
## <chr> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
## 1 ENSMUSG00000068129 UP 6.48 1.97e-199 933. 0.213 30.5 9.44e-204
## 2 ENSMUSG00000079293 UP 4.28 3.32e-140 468. 0.167 25.6 3.17e-144
## 3 ENSMUSG00000030789 UP 4.91 4.43e-121 454. 0.206 23.8 6.35e-125
## 4 ENSMUSG00000018927 UP 2.74 1.44e- 91 441. 0.132 20.7 2.75e- 95
## 5 ENSMUSG00000000982 UP 3.46 1.60e- 79 80.3 0.179 19.3 3.83e- 83
## 6 ENSMUSG00000000682 UP 2.35 1.92e- 70 187. 0.129 18.2 5.52e- 74
## 7 ENSMUSG00000046805 UP 1.55 1.06e- 68 4466. 0.0864 18.0 3.56e- 72
## 8 ENSMUSG00000021423 UP 1.46 2.71e- 62 1263. 0.0851 17.1 1.04e- 65
## 9 ENSMUSG00000059498 UP 1.16 1.20e- 60 1039. 0.0685 16.9 5.14e- 64
## 10 ENSMUSG00000045502 UP 3.73 3.88e- 58 35.0 0.225 16.5 1.85e- 61
## # … with 33,261 more rows, and abbreviated variable names ¹volc_plot_status,
## # ²log2FoldChange, ³baseMean
## # ℹ Use `print(n = ...)` to see more rows
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : There are ties in the preranked stats (0% of the list).
## The order of those tied genes will be arbitrary, which may produce unexpected results.
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize,
## gseaParam, : There are duplicate gene names, fgsea may produce unexpected
## results.
## # A tibble: 190 × 8
## pathway pval padj log2err ES NES size leadi…¹
## <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <int> <list>
## 1 WP_NONHOMOLOGOUS_END_JOINING 0.334 0.577 0.114 -0.536 -1.12 6 <chr>
## 2 WP_REGULATION_OF_CARDIAC_HYP… 0.468 0.679 0.0934 -0.517 -1.02 5 <chr>
## 3 WP_GLYCOGEN_METABOLISM 0.785 0.964 0.0793 -0.235 -0.781 34 <chr>
## 4 WP_METHYLATION 0.806 0.976 0.0660 -0.302 -0.719 9 <chr>
## 5 WP_ACE_INHIBITOR_PATHWAY 0.820 0.976 0.0648 -0.319 -0.699 7 <chr>
## 6 WP_SPLICING_FACTOR_NOVA_REGU… 0.946 1 0.0727 -0.199 -0.689 41 <chr>
## 7 WP_IRINOTECAN_PATHWAY 0.832 0.981 0.0628 -0.328 -0.681 6 <chr>
## 8 WP_EXERCISEINDUCED_CIRCADIAN… 0.961 1 0.0755 -0.189 -0.674 49 <chr>
## 9 WP_HYPOTHETICAL_NETWORK_FOR_… 0.945 1 0.0683 -0.204 -0.658 31 <chr>
## 10 WP_AMINO_ACID_METABOLISM 0.980 1 0.0917 -0.169 -0.649 96 <chr>
## # … with 180 more rows, and abbreviated variable name ¹leadingEdge
## # ℹ Use `print(n = ...)` to see more rows
## Hippocampus NES ordered fgsea results saved in file: 'Hippocampus_NES_ordered_fgsea_results_APP_all_FC0.csv'
15. FGSEA on Thomas CSV
Batch_of_192_Trimmed_Hippo_DESeq2_Control_v_Supp_12mo_APP_DGE_Analysis_sex_controlled_padj_sorted_7_23_2022.csv
## ************** FGSEA on Thomas CSV: log2FoldChange threshold = 0 **************
## # A tibble: 17,899 × 8
## genes volc_plot_…¹ log2F…² padj baseM…³ lfcSE stat pvalue
## <chr> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
## 1 ENSMUSG00000039617 DOWN -21.9 1.44e-8 6.91 3.06 -7.15 8.74e-13
## 2 ENSMUSG00000064293 UP 0.819 1.54e-8 491. 0.116 7.04 1.87e-12
## 3 ENSMUSG00000057455 UP 0.372 2.95e-6 1937. 0.0599 6.21 5.38e-10
## 4 ENSMUSG00000052861 DOWN -1.84 6.44e-6 108. 0.305 -6.04 1.56e- 9
## 5 ENSMUSG00000034467 DOWN -1.36 7.68e-6 47.5 0.227 -5.97 2.33e- 9
## 6 ENSMUSG00000055430 UP 0.529 1.17e-5 4625. 0.0900 5.87 4.26e- 9
## 7 ENSMUSG00000039155 DOWN -3.17 1.26e-5 24.6 0.542 -5.84 5.33e- 9
## 8 ENSMUSG00000037627 DOWN -1.77 1.59e-5 46.1 0.307 -5.77 7.73e- 9
## 9 ENSMUSG00000028546 UP 0.515 9.97e-5 1264. 0.0954 5.40 6.52e- 8
## 10 ENSMUSG00000039543 DOWN -1.46 9.97e-5 36.3 0.271 -5.40 6.66e- 8
## # … with 17,889 more rows, and abbreviated variable names ¹volc_plot_status,
## # ²log2FoldChange, ³baseMean
## # ℹ Use `print(n = ...)` to see more rows
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize,
## gseaParam, : There are duplicate gene names, fgsea may produce unexpected
## results.
## # A tibble: 190 × 8
## pathway pval padj log2err ES NES size leadi…¹
## <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <int> <list>
## 1 WP_TYPE_II_INTERFERON_SIGNA… 0.00642 0.754 0.407 -0.697 -1.70 29 <chr>
## 2 WP_MACROPHAGE_MARKERS 0.0205 0.754 0.352 -0.798 -1.58 10 <chr>
## 3 WP_EICOSANOID_METABOLISM_VI… 0.0400 0.754 0.322 -0.634 -1.53 28 <chr>
## 4 WP_INFLAMMATORY_RESPONSE_PA… 0.0431 0.754 0.277 -0.634 -1.53 27 <chr>
## 5 WP_LEPTININSULIN_SIGNALING_… 0.0475 0.754 0.271 -0.704 -1.51 16 <chr>
## 6 WP_RETINOL_METABOLISM 0.0522 0.754 0.322 -0.607 -1.51 34 <chr>
## 7 WP_DYSREGULATED_MIRNA_TARGE… 0.0589 0.754 0.234 -0.620 -1.48 26 <chr>
## 8 WP_NUCLEOTIDE_GPCRS 0.0731 0.754 0.214 -0.721 -1.47 11 <chr>
## 9 WP_GLUTATHIONE_METABOLISM 0.0735 0.754 0.211 -0.649 -1.44 19 <chr>
## 10 WP_MATRIX_METALLOPROTEINASES 0.0731 0.754 0.211 -0.613 -1.42 22 <chr>
## # … with 180 more rows, and abbreviated variable name ¹leadingEdge
## # ℹ Use `print(n = ...)` to see more rows
## THippo NES ordered fgsea results saved in file: 'THippo_NES_ordered_fgsea_results_APP_only_FC0.csv'
## ************** FGSEA on Thomas CSV: log2FoldChange threshold = 1 **************
## # A tibble: 17,899 × 8
## genes volc_plot_…¹ log2F…² padj baseM…³ lfcSE stat pvalue
## <chr> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
## 1 ENSMUSG00000039617 DOWN -21.9 1.44e-8 6.91 3.06 -7.15 8.74e-13
## 2 ENSMUSG00000064293 DOWN 0.819 1.54e-8 491. 0.116 7.04 1.87e-12
## 3 ENSMUSG00000057455 DOWN 0.372 2.95e-6 1937. 0.0599 6.21 5.38e-10
## 4 ENSMUSG00000052861 DOWN -1.84 6.44e-6 108. 0.305 -6.04 1.56e- 9
## 5 ENSMUSG00000034467 DOWN -1.36 7.68e-6 47.5 0.227 -5.97 2.33e- 9
## 6 ENSMUSG00000055430 DOWN 0.529 1.17e-5 4625. 0.0900 5.87 4.26e- 9
## 7 ENSMUSG00000039155 DOWN -3.17 1.26e-5 24.6 0.542 -5.84 5.33e- 9
## 8 ENSMUSG00000037627 DOWN -1.77 1.59e-5 46.1 0.307 -5.77 7.73e- 9
## 9 ENSMUSG00000028546 DOWN 0.515 9.97e-5 1264. 0.0954 5.40 6.52e- 8
## 10 ENSMUSG00000039543 DOWN -1.46 9.97e-5 36.3 0.271 -5.40 6.66e- 8
## # … with 17,889 more rows, and abbreviated variable names ¹volc_plot_status,
## # ²log2FoldChange, ³baseMean
## # ℹ Use `print(n = ...)` to see more rows
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize,
## gseaParam, : There are duplicate gene names, fgsea may produce unexpected
## results.
## # A tibble: 190 × 8
## pathway pval padj log2err ES NES size leadi…¹
## <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <int> <list>
## 1 WP_TYPE_II_INTERFERON_SIGNAL… 0.0209 0.806 0.352 -0.697 -1.66 29 <chr>
## 2 WP_MACROPHAGE_MARKERS 0.0213 0.806 0.352 -0.798 -1.59 10 <chr>
## 3 WP_LEPTININSULIN_SIGNALING_O… 0.0440 0.806 0.277 -0.704 -1.52 16 <chr>
## 4 WP_EICOSANOID_METABOLISM_VIA… 0.0426 0.806 0.271 -0.634 -1.51 28 <chr>
## 5 WP_INFLAMMATORY_RESPONSE_PAT… 0.0459 0.806 0.262 -0.634 -1.50 27 <chr>
## 6 WP_RETINOL_METABOLISM 0.0450 0.806 0.262 -0.607 -1.50 34 <chr>
## 7 WP_NUCLEOTIDE_GPCRS 0.0653 0.806 0.225 -0.721 -1.46 11 <chr>
## 8 WP_DYSREGULATED_MIRNA_TARGET… 0.0569 0.806 0.234 -0.620 -1.46 26 <chr>
## 9 WP_GLUTATHIONE_METABOLISM 0.0764 0.806 0.207 -0.649 -1.42 19 <chr>
## 10 WP_MATRIX_METALLOPROTEINASES 0.0816 0.806 0.196 -0.613 -1.40 22 <chr>
## # … with 180 more rows, and abbreviated variable name ¹leadingEdge
## # ℹ Use `print(n = ...)` to see more rows
## THippo NES ordered fgsea results saved in file: 'THippo_NES_ordered_fgsea_results_APP_only_FC1.csv'